data <- read.csv("./Data/def1955.csv")
set.seed(1)

coef.boot <- NULL
for(i in 1:200){
	sampi <- sample(unique(data$t),length(unique(data$t)),rep=T)
	indi <- NULL
	for(j in 1:length(sampi)){
		indi <- c(indi,which(data$t==sampi[j]))
	}
	datai <- data[indi,]
	esti <- glm(y~kstar2+gwesp+midhistt+coment+threatt+contigt+jntdemt+demdift+majpowt+dydistt+tradet,data=datai,family=binomial)
	coef.boot <- rbind(coef.boot,rbind(coef(esti)))
	print(i)
}
write.csv(data.frame(coef.boot),"./Data/def1955res1.csv")



		
